import request from './request'

// 请求首页的数据
export const GetHomeLists = () => request.get('/index/index')

// 搜索功能
export const GetSearchList = () => request.get('/search/index');

// 获取实时搜索的文本提示数据列表
export const GetSearchTipsListData = (params) => request.get('/search/helper', {
    params
})

// 获取搜索商品列表数据
export const GetGoodsListData = (params) => request.get('/goods/list', {
    params
})

// 获取当前分类商品类别数据
export const GetCurrentGoodsLsitData = (params) => request.get('catalog/current', {
    params
})

// 清除历史记录
export const ClearHistory = () => request.post('/search/clearhistory')

// 登录请求
export const GoLogin = params => request.post("/auth/loginByWeb", params)

// 商品详情
export const GetGoodsDetailData = params => request.get("/goods/detail", {
    params
})

// 获取相关产品
export const GetGoodsRelatedData = params => request.get('/goods/related', {
    params
});

// 获取购物车数据
export const GetCartData = () => request.get('/cart/index')

// 加入购物车
export const AddProductToCart = params => request.post("/cart/add", params)

// 获取购物车数据
export const GetCartListData = () => request.get("/cart/index")


// 点击切换商品选中状态
export const ChangeGoodChecked = params => request.post("/cart/checked",params)

// 步进器的请求
export const StepperChangeData = params => request.post("/cart/update",params)

// 删除商品
export const DeleteGood = params => request.post("/cart/delete",params)

// 品牌详情
export const GetBrandDetail = params => request.get('/brand/detail', params)

// 分类数据
export const GetCategoryData =() => request.get('/catalog/index')

// 当前分类数据
export const GetCurrentCategoryData = params => request.get('/catalog/current',{params})

// 专题页面数据
export const GetTopicData = () => request.get('/topic/list')

// channel数据获取
export const GetChannelData = papams =>{
    return request.get('/goods/category', {
        params:papams
    })
}

// 获取当前分类页面数据
export const GetCurrentChannelData = params => request.get('/goods/list', {params});

